package com.ketangpai.controller;

import com.ketangpai.entity.Student;
import com.ketangpai.entity.Teacher;
import com.ketangpai.service.RegisterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author jiahao
 * @date 2024/2/13 0:15
 */
@RestController
@RequestMapping("/register")
public class RegisterController {
    @Autowired
    RegisterService registerService;
    @PostMapping("/insert/teacher")
    public int insertTeacher(@RequestBody Teacher teacher) {
        System.out.println(teacher);
        return registerService.register(teacher);
    }
    @PostMapping("/insert/student")
    public int insertStudent(Student student) {
       return registerService.register(student);
    }
}
